﻿
@{
    var name = ViewBag.AuthorName;
    var Photo = ViewBag.AuthorPhoto;
    var Id = ViewBag.AuthorId;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>AuthorInfo</title>
    <link rel="stylesheet" href="~/Web/css/Author.css" />
</head>
<body>

    <div class="container-fulid">
        <div class="row body-pad">
            <div class="col-md-12">
                <div class="row">
                    <div class="col-md-8 offset-md-2 Author" style="background-color: #FFFFFF;">
                        <div class="row Author-Info">

                            <div class="col-md-1 Author-Image">
                                <img src="~/Web/UsersImage/@Photo" alt="" style="width: 80px; height: 80px;">
                            </div>

                            <div class="col-md-9 Author-Desc">
                                <div>@name</div>
                                <div>这个人很懒,什么都没有留下~</div>
                            </div>

                            <div class="col-md-2 Author-attention">
                                <a href="javascript:void(0);">关注</a>
                            </div>

                        </div>

                        <div class="row ">
                            <div class="col-md-11 offset-md-1">
                                <!-- <div>个人描述:这个人很懒，什么都没有留下~</div> -->
                            </div>
                        </div>

                    </div>
                </div>

            </div>
        </div>

        <div class="row Author-Body body-pad">
            <div class="col-md-12">
                <div class="row">
                    <div class="col-md-2 offset-md-2 Author-left" style="background-color: #FFFFFF;">
                        <div class="row specialColumn">
                            <div class="col-md-12">
                                <a href="javascript:void(0);">
                                    <div>TA的专栏</div>
                                </a>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-12 User-column">
                                <div><a href="javascript:void(0);">—TA的专栏1</a></div>
                                <div><a href="javascript:void(0);">—TA的专栏1</a></div>
                                <div><a href="javascript:void(0);">—TA的专栏1</a></div>
                                <div><a href="javascript:void(0);">—TA的专栏1</a></div>
                                <div><a href="javascript:void(0);">—TA的专栏1</a></div>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6 Author-right" style="background-color: #FFFFFF;">
                        <div class="row">
                            <div class="col-md-12 Author-Content">
                                <div><a href="javascript:void(0);">文章</a></div>
                                <div><a href="javascript:void(0);">最近</a></div>
                                <div><a href="javascript:void(0);">资源</a></div>
                                <div><a href="javascript:void(0);">帖子</a></div>
                                <div><a href="javascript:void(0);">收藏</a></div>
                            </div>
                        </div>

                        <div class="row" id="article"></div>

                    </div>
                </div>

            </div>

        </div>

        <div style="height:100px;"></div>

    </div>

    @section Scripts
    {
        <script>

            $.get("../../Home/GetColumn",{id:@Id},function(data)
            {
                console.log(data);
                let str = "";
                for(let i = 0; i < data.length; i++)
                {
                    str += "<div><a href='javascript:void(0);'>—"+ data[i].columnName +"</a></div>";
                }
                $(".User-column").html(str);
            },"json");

            $.get("../../Home/GetAuthorArticle",{id:@Id},function(data)
            {
                console.log(data);

                let str = "";
                for(let i = 0; i < data.length; i++)
                {
                    str += "<div class='col-md-12 Author-Right-Body'>";

                    str += "<div class='row'>";
                    str += "<div class='col-md-12 Author-Article-Title'>";
                    str += "<div>";
                    str += "<a href='../../Home/Article/"+ data[i].id +"'>"+ data[i].title +"</a>";
                    str += "</div>";
                    str += "</div>";
                    str += "</div>";

                    str += "<div class='row'>";
                    str += "<div class='col-md-12 Author-Article-Content'>";
                    str += "<div>";
                    str += "<a href='../../Home/Article/"+ data[i].id +"'>";
                    str += "<span>"+ data[i].content +"</span>"
                    str += "</a>";
                    str += "</div>";
                    str += "</div>";
                    str += "</div>";

                    str += "<div class='row'>";
                    str += "<div class='col-md-12 Author-Article-Button'>";
                    str += "<div>"+ data[i].publishTime +"</div>";
                    str += "<div>"+ data[i].like +"</div>";
                    str += "</div>";
                    str += "</div>";
                    str += "</div>";
                }
                $("#article").html(str);
            },"json");

        </script>
    }

</body>
</html>
